<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: inc.banner_exists.php 134 2013-09-22 07:28:26Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 134 $
* 	zuletzt geaendert von:	$Author: peter $
* 	Datum:					$Date: 2013-09-22 07:28:26 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */


function banner_exists($action, $identifier) {
	global $db;

	if($action == 'dynamic') {
		$banner = $db->db_query("SELECT banners_group, banners_id, banners_title, banners_image, banners_html_text FROM " . TABLE_BANNERS . " WHERE status = '1' and banners_group = '" . $identifier . "'");
		return $banner->fields['banners_group'];

	} elseif ($action == 'static') {
		$banner = $db->db_query("SELECT banners_id, banners_title, banners_image, banners_html_text FROM " . TABLE_BANNERS . " WHERE status = '1' and banners_group = '' LIMIT 1");
		return $banner->fields['banners_id'];

	} else
		return false;
}
?>